home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 23 / AACD 23.iso / AACD / Utilities / BareED / DAC / source / bareed_dac.h next >
C/C++ Source or Header  |  2001-04-17  |  6KB  |  171 lines

  1. #ifndef BAREED_DAC_H
  2.     #define BAREED_DAC_H
  3. /*
  4.     BAREED_DAC
  5.  
  6.     (C) Copyright 2001 J.v.d.Loo
  7.  
  8.     Any declared pointer (below) is only readable because it points to a BareED intern variable!
  9.     Never change it!!!
  10.  
  11.     Any DAC-application can be compiled for a 68020 CPU since BareED itself presupposes it!    
  12. */
  13.  
  14. #ifndef EXEC_LIBARIES_H
  15.     #include <exec/libraries.h>
  16. #endif
  17.  
  18. #ifndef GRAPHICS_GFXBASE_H
  19.     #include <graphics/gfxbase.h>
  20. #endif
  21.  
  22. #ifndef INTUITION_INTUITIONBASE_H
  23.     #include <intuition/intuitionbase.h>
  24. #endif
  25.  
  26. #ifndef INTUITION_SCREENS_H
  27.     #include <intuition/screens.h>
  28. #endif
  29.  
  30. #ifndef WORKBENCH_STARTUP_H
  31.     #include <workbench/startup.h>
  32. #endif
  33.  
  34. #ifndef LIBRARIES_LOCALE_H
  35.     #include <libraries/locale.h>
  36. #endif
  37.  
  38.  
  39. /* Returned by "pm_CreateProgressBar()" - see below.
  40.    Don't assume anything about the ProgressBar more than here stated -
  41.    in real it has got much more items!
  42. */
  43. struct ProgressBar
  44. {
  45.     struct Window *pb_Window;
  46. };
  47.  
  48.  
  49. struct PseudoMsg
  50. {
  51.     /* Normal start-up-message, with one argument (path & filename)
  52.        ln_Name points to "BAREED"
  53.        ln_Pri set to zero (= version of this structure - 0 means beta)
  54.     */
  55.     struct WBStartup      pm_Startup;
  56.  
  57.     /* Following is private, do not read or modify! */
  58.     BPTR                 pm_Lock;
  59.     unsigned char        *pm_Name;
  60.     unsigned char         pm_FileName[108];
  61.     unsigned char         pm_Dir[256];
  62.  
  63.     /* Library bases (assume at least all are v36, except: Asl v38, Icon & Diskfont v33, Locale v1) */
  64.     struct GfxBase        *pm_GfxBase;
  65.     struct IntuitionBase *pm_IntuitionBase;
  66.     struct Library        *pm_GadToolsBase;
  67.     struct Library        *pm_DiskfontBase;
  68.     struct Library        *pm_AslBase;
  69.     struct Library        *pm_IconBase;
  70.     struct LocaleBase    *pm_LocaleBase;
  71.     struct Library        *pm_WorkbenchBase;
  72.  
  73.     /* If you have to do own rendering using GadTools, these two may help you.
  74.        But beware of releasing them - BareED is the owner!
  75.     */
  76.     void                *VisualInfo;            /* Never release it! */
  77.     struct DrawInfo        *DrawInfo;                /* Never release it! */
  78.  
  79.     /* Storage (buffer) start and size */
  80.     unsigned char        *pm_RegionStart;
  81.     unsigned int         pm_RegionSize;
  82.  
  83.     /* Archive start and end */
  84.     unsigned char        *pm_TextStart;
  85.     unsigned char        *pm_TextEnd;
  86.  
  87.     /* Application was started with this marked block */
  88.     unsigned char        *pm_BlockStart;
  89.     unsigned char        *pm_BlockEnd;
  90.  
  91.     /* Editor is using this attribute for the used font */
  92.     struct TextAttr        *pm_FontAttr;
  93.  
  94.     /* By editor used font */
  95.     struct TextFont        *pm_Font;
  96.  
  97.     /* The editor's surrounding */
  98.     struct Window        *pm_EdWindow;
  99.  
  100.     /* How wide is a tab character in pixels */
  101.     unsigned int         pm_TabWidth;
  102.  
  103.     /* A tab stop occurs every 'n' characters (almost!) */
  104.     unsigned int         pm_TabStops;
  105.  
  106.     /* Rightmost offset set to 'n' characters (may zero!!!) */
  107.     unsigned int         pm_RightMargin;
  108.  
  109.     /* Pointer to 256 bytes - same order like LATIN-1 char-set - where each byte holds
  110.        the width of the concerned character, e. g. at offset 32 the width of the SPACE-
  111.        character can be found
  112.     */
  113.     unsigned char        *pm_CharSpace;            /* Pointer to the character-spaces of the used font */
  114.  
  115.     /* Currently, following two function pointers are out of order (they are empty!!!)
  116.        To check if the current BareED version support those two, check them against zero!
  117.     */
  118.     void                (*pm_GetAttr)( struct TagItem *taglist);
  119.     void                (*pm_ChangeAttr)( struct TagItem *taglist);
  120.  
  121.     /* Two functions to permit/allow modifications through user-interface --- NOTE:
  122.        Since BareED protects the archive against modification (user/Arexx) there is no need to
  123.        call these functions - furthermore - even if you call AllowInput() it will not turn off
  124.        the protection - it only allows the user to scroll around in the text-file (for example)
  125.        which is anyway the defaulted mode!
  126.     */
  127.     void                (*pm_BlockInput)( void);
  128.     void                (*pm_AllowInput)( void);
  129.  
  130.     /* Display a simple text-requester whithout inhibiting the user from changing BareED's
  131.        interface. You could call BlockInput() first...
  132.     */
  133.     void                (*pm_Tell)( STRPTR str);
  134.  
  135.  
  136.     /* Display a simple text-requester without inhibiting the user from changing BareED's
  137.        interface. The user can react on the requester with "YES" or "NO".
  138.     */
  139.     unsigned int        (*pm_CaseTell)( STRPTR str);
  140.  
  141.     /* Display a simple number-requester with inhibiting the user from changing BareED's
  142.        interface!
  143.         initial     = intial number for the string-gadget that may be changed by the user later on
  144.         winname  = title of the requester
  145.         hailtext = the text displayed as body
  146.         gadtext  = there is only one bool-gadget in this requester, this is the string for it
  147.         zero     = must be set to zero!
  148.        Returns NULL if user abandoned or the entered number
  149.     */
  150.     unsigned int        (*pm_RequestNumber)( unsigned int initial, STRPTR winname, STRPTR hailtext, STRPTR gadtext, BOOL zero);
  151.  
  152.     /* Four functions - please refere to the DAC-guide for function-reference */
  153.     unsigned int        (*pm_StrPixelLen)( unsigned char *start, unsigned char *end);
  154.     void                (*pm_DumpStrLine)( unsigned char *start, unsigned char *end, struct RastPort *rp, unsigned int x, unsigned int y);
  155.     unsigned int        (*pm_WidestStrLen)( unsigned char *text, unsigned char *stop, unsigned int (*inform_code)( unsigned int len, unsigned int line), unsigned int inform);
  156.     void                (*pm_DumpStrings)( struct RastPort *rp, unsigned int (*dump_code)( unsigned int len, unsigned int line), unsigned char *text, unsigned char *stop);
  157.  
  158.     /* Functions attached to the progress-bar - refere to DAC-guide... */
  159.     void                (*pm_FreeProgressBar)( struct ProgressBar *pb);
  160.     struct ProgressBar *(*pm_CreateProgressBar)( STRPTR wintitle, STRPTR hail, STRPTR stop, STRPTR cont, STRPTR cancel);
  161.     unsigned int        (*pm_PullPBarEvent)( struct ProgressBar *pb);
  162.     void                (*pm_ChangePBarIndicator)( struct ProgressBar *pb, unsigned int percent, STRPTR hail);
  163.  
  164.     /* <<< Following does not work properly yet - so don't use! >>>
  165.     */
  166.     void                (*pm_TogglePBarGad)( struct ProgressBar *pb);
  167.  
  168. };
  169.  
  170. #endif
  171.